home *** CD-ROM | disk | FTP | other *** search
- /*/*************************************************************************
- ** Apple Macintosh Developer Technical Support
- **
- ** Macintosh ATA Manager Sample
- **
- ** by Brian Bechtel, <devsupport@apple.com>
- ** Apple Developer Technical Support
- **
- ** File: ATA_powerpc.h
- **
- ** Copyright © 1997 Apple Computer, Inc.
- ** All rights reserved.
- **
- ** You may incorporate this sample code into your applications without
- ** restriction, though the sample code has been provided "AS IS" and the
- ** responsibility for its operation is 100% yours. However, what you are
- ** not permitted to do is to redistribute the source as "DSC Sample Code"
- ** after having made changes. If you're going to re-distribute the source,
- ** we require that you make it clear in the source that the code was
- ** descended from Apple Sample Code, but that you've made changes.
- **
- **************************************************************************/
-
- /*/*************************************************************************
- ** This definition is only used if you are generating CFM. In those cases,
- ** the "ataManager" call isn't defined. See technote 1098 for details.
- **************************************************************************/
-
- #if GENERATINGCFM
- pascal SInt16 ataManager(ataPB *pb);
-
- #define RESULT_OFFSET(type) \
- ((sizeof(type) == 1) ? 3 : ((sizeof(type) == 2) ? 1 : 0))
- #define TBTrapTableAddress(trapNum) (((trapNum & 0x03FF) << 2) + 0xE00)
-
- pascal SInt16 ataManager(ataPB *pb)
- {
- #ifdef applec
- #if sizeof(SInt16) > 4
- #error "Result types larger than 4 bytes are not supported."
- #endif
- #endif
- long private_result;
-
- private_result = CallUniversalProc(
- *(UniversalProcPtr*)TBTrapTableAddress(0xAAF1),
- kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(SInt16)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(pb))),
- pb);
- return *(((SInt16*)&private_result) + RESULT_OFFSET(SInt16));
- }
- #endif
-